package com.cy.pj.module.controller;

import com.cy.pj.module.pojo.ResponseResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class JsonObjectController {
@ResponseBody
@RequestMapping("/doConvertResponseToJson")
    public ResponseResult doConvertTesponseToJson(){
    ResponseResult r=new ResponseResult();
    r.setCode(200);
    r.setMessage("update ok");
    return r;
}
    @RequestMapping("/doConvertMapToJson")
    public Map<String,Object> doConvertMapToJson(){
        Map<String,Object> map=new HashMap<>();
        map.put("username","刘德华");
        map.put("state",true);
        return map;
    }


}
